

/* let promise1 = new Promise((resolve,reject)=>{
    resolve('成功');
});
const promise2 = promise1.then(
function onFulfilled(value){
    //console.log('onFulfilled1',value);
    //1.如果返回的是一个普通的值，不是对象或函数
    return 100;
},function onRejected(reason){
    console.log('onRejected1',reason);
});
promise2.then((value)=>{
    console.log('onFulfilled2',value);
}) */


let promise1 = new Promise((resolve,reject)=>{
    resolve('成功');
});
const promise2 = promise1.then(
function onFulfilled(value){
    //console.log('onFulfilled1',value);
    //1.如果返回是一个新的Promise也就是x的话,那会使用新的promise来决定promise2
    return new Promise((resolve,reject)=>{
        //resolve('新成功');
        reject('新失败');
    });
},function onRejected(reason){
    console.log('onRejected1',reason);
});
promise2.then((value)=>{
    console.log('onFulfilled2',value);
},(reason)=>{
    console.log('onRejected2',reason);
})
